package com.cskaoyan.mapper;

import com.cskaoyan.bean.entity.Order;
import com.cskaoyan.bean.entity.OrderExample;
import com.cskaoyan.bean.vo.WxOrderListRespVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {
    long countByExample(OrderExample example);

    int deleteByExample(OrderExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Order record);

    int insertSelective(Order record);

    List<Order> selectByExample(OrderExample example);

    Order selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Order record, @Param("example") OrderExample example);

    int updateByExample(@Param("record") Order record, @Param("example") OrderExample example);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    void updateStatusByOrderId(@Param("status") Integer modifyCode, @Param("id") Integer orderId);

    List<WxOrderListRespVo> selectOrderListByStatus(@Param("showType") Short showType, @Param("status") Short status);

    Integer selectUserIdByOrderId(Integer orderId);

    // 根据订单id修改待评价订单商品数量
    void updateCommentsByOrderId(@Param("status") Short status, @Param("id") Integer orderId);

    int updateOrderStatusByOrderId(@Param("status") Short srcStatus,@Param("order") Order order);

    int updateOrderDeleted(Integer orderId);

    // 根据订单状态401，402获取comment不为0字段的商品总个数
    List<Order> selectUnCommentNumByOrderStatus(@Param("userRecvStatus") String userRecvStatus, @Param("systemRecvStatus") String systemRecvStatus);

    int selectOrderSnUnique(String orderSn);

    // 根据订单状态101，获取comment不为0的订单
    Integer selectUnpaidOrderNumByOrderStatus(String unpaidStatus);
}